from selenium import webdriver
from selenium.webdriver.common.by import By
import re

class SeleniumSpider(object):
    # 初始化
    # 定义初始页面url
    def __init__(self):
        self.url = 'https://maoyan.com/board/4?offset={}'
        self.driver = webdriver.Edge()
        self.driver.implicitly_wait(1)

    def get_html_by_Selenium(self,url):
        self.driver.get(url)
        html=self.driver.page_source
        #print(html)
        # "<div class="title">【天章纸品】 绿天章送货单商业凭证32K无碳二联三联送货单竖式横式10本包邮</div>"
        re_bds = '<div class="title">(.*?)</div>'
        pattern = re.compile(re_bds, re.S)
        r_list = pattern.findall(html)
        print(r_list)